import Cookies from 'js-cookie'

const TokenKey = 'token'

const timeKey = 'time' // 用来作为时间戳存储的key

export function getToken() {
  return localStorage.getItem(TokenKey)
}

export function setToken(token) {
    localStorage.setItem(TokenKey, token);
}

export function removeToken() {
    localStorage.removeItem(TokenKey)
}

export function setTimeStamp() {
  // 设置当前最新的时间戳
  // Date.now()  new Date.getTime()
  localStorage.setItem(timeKey, Date.now())
}

export function getTimeStamp() {
    return localStorage.getItem(timeKey)
}
